package com.turing.post.thirdinterface.util;

import java.util.HashMap;

public class ThirdInterfaceRespCode {
	private final static HashMap<String, String> _msgmap = new HashMap<String, String>();
	
	/**
	 * 初始化_msgmap,在本类第一次被加载之后
	 */
	static {
		_msgmap.put(ThirdInterfaceRespCode.RC_ARGS_NULL, "参数为NULL!");
		_msgmap.put(ThirdInterfaceRespCode.BRANCHNO_EXIST, "编号已经存在!");
		_msgmap.put(ThirdInterfaceRespCode.OPERID_OPERBRANCHNO_NOTEXIST, "用户所在机构编号不存在!");
		_msgmap.put(ThirdInterfaceRespCode.CONSUMETERMINAL_INSERT_UPDATE, "ConsumeTerminal");
		_msgmap.put(ThirdInterfaceRespCode.CARD_NO_NULL, "卡号为空");
		_msgmap.put(ThirdInterfaceRespCode.CARD_NO_ERR, "卡号有误");
		_msgmap.put(ThirdInterfaceRespCode.TranDate_ERR, "交易日期或时间错误有误");
	}
	/** 
	 * 参数为NULL
	 */
	public final static String RC_ARGS_NULL = "RC_ARGS_NULL";
	
	/** 
	 * 信息错误
	 */
	public final static String RC_INFO_ERROR = "RC_INFO_ERROR";
	
	/**
	 * 机构号已经存在
	 */
	public final static String BRANCHNO_EXIST = "BRANCHNO_EXIST";
	
	/**
	 * 用户所在机构编号不存在
	 */
	public final static String OPERID_OPERBRANCHNO_NOTEXIST = "OPERID_OPERBRANCHNO_NOTEXIST";
	
	/**
	 * 商户脱机消费终端
	 */
	public final static String CONSUMETERMINAL_INSERT_UPDATE = "ConsumeTerminal";
	
	
	/**
	 * 30 格式错误
	 */
	public final static String RC_PARAMETER = "30";
	/**
	 * 90 Socket连接错误
	 */
	public final static String RC_SOCKET = "90";
	/**
	 * 96 系统错误
	 */
	public final static String RC_SYS = "96";
	

	/**
	 * 卡号为空
	 */
	public final static String CARD_NO_NULL = "CARD_NO_NULL";
	

	/**
	 * 卡号有误
	 */
	public final static String CARD_NO_ERR = "CARD_NO_ERR";
	
	/**
	 * 交易日期或时间错误有误
	 */
	public final static String TranDate_ERR = "TranDate_ERR";
	
	
	/**
	 * 根据响应码查询响应信息
	 * 
	 * @param respCode
	 * @return
	 */
	public static String getRespCodeMessage(String respCode) {
		String msg = _msgmap.get(respCode);
		return (msg == null) ? respCode : msg;
	}
}
